#ifndef CLIENT_HH_
# define CLIENT_HH_

# include <sys/types.h>
# include <sys/socket.h>
# include <netdb.h>

//# include "common/NetworkDevice.hh"
# include "constants/network.h"

/** Conncetion to a server
 **
 */

class Client// : public NetworkDevice
{
public:
  // rm default Ctor
  Client(char* host, char* port, int msgCount, char** msgList);
  ~Client();

  void init();
  void buildHints();
  void run();


private:
  char* _host;
  char* _port; // shd be an int, in NetworkDevice...
  int _msgCount;
  char** _msgList;

  // NOTE: why must be here ?

  // _socket
  struct addrinfo _hints;

  struct addrinfo *_result, *_rp;
  int _sfd, _s;
  struct sockaddr_storage _peerAddr;
  socklen_t _peerAddrLen;
  ssize_t _nread;
  char _buf[SERVER_BUF_SIZE];
};

#endif /* !CLIENT_HH_ */
